<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div class="container">
  <h1>授权</h1>

  <th:block sec:authorize="isAuthenticated()">
    <h2>Please Confirm</h2>

    <form id="confirmationForm" name="confirmationForm"
          th:action="@{/oauth/authorize}" method="post">
      <input name="user_oauth_approval" value="true" type="hidden"/>
      <ul class="list-unstyled">
        <th:block th:each="scope:${scopes}">
          <li>
            <div class="form-group">
              <label th:text="${scope.key}"/> :
              <input type="radio" th:name="${scope.key}" value="true"
                     th:checked="${scope.value}">Approve</input>
              <input type="radio" th:name="${scope.key}" value="false"
                     th:checked="${scope.value}">Deny</input>
            </div>
          </li>
        </th:block>
      </ul>
      <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
      <button class="btn btn-primary">Submit</button>
    </form>

  </th:block>

</div>


</body>
</html>